<?php echo $this->Session->flash(); ?>
<script>
$(function(){
    $('#boton').click(function(){
        
        
        var x=$('#txt').attr('value');
        var y= $('#area').attr('value');
        x=x.toUpperCase(x);
        if(y!=""){
            y=y+'\n'+x;
        }else{
            y=x;
        }
        
        $('#area').attr('value',y)
        $('#txt').attr('value','')
    });
    $('#boton1').click(function(){
       var tx=$('#area').attr('value');
       lineas=tx.split('\n');
       lineas.pop();
       tx=lineas.join('\n');
        $('#area').attr('value',tx);
    });
})
</script>
<h1>3. DOCUMENTOS SUMINISTRADOS </h1>

<div id="loading" style="display: none;">
    <?php echo $html->image('loading.gif', array('border' => "0", 'align' => 'center')); ?>
</div>

<fieldset>
    <table >
       
        <tbody>
            <tr>
                <td><?php echo $this->Form->textarea('',array('label'=>'Documento','id'=>'txt','class'=>'txtarea'));?></td>
            
                <td><?php echo $this->Form->button('Adicionar', array('type'=>'button','id'=>'boton')); ?></td>
            </tr>
        </tbody>
    </table>
    <?php  echo $form->create('Appraisal')?>
 <table >
       
        <tbody>
            <tr>
                <td><?php echo $form->input('Appraisal.documentos_suministrados', array('class'=>'txtarea', 'label' => "Documentos suministrados",'id'=>'area','readonly'=>'readonly'));?></td>
            
                <td><?php echo $this->Form->button('Eliminar', array('type'=>'button','id'=>'boton1')); ?></td>
            </tr>
        </tbody>
    </table>
    <?php echo $form->input('Appraisal.id'); ?>
    <?php if($this->data['Appraisal']['bloqueo']=="No")
    echo $ajax->submit('Guardar', array('url' => array('controller' => 'Appraisals', 'action' => 'docs_sum', $this->data['Appraisal']['id']), 'update' => 'docs_sum', 'complete' => 'mayusculas()', 'indicator' => 'loading'));
    echo $form->end();
    ?>
    <?php echo $ajax->link($html->image("regresar.gif", array('width' => '30', 'heigth' => '30', 'alt' => 'regresar', 'align' => 'center')), array('controller' => 'Appraisals', "action" => "docs_sum_index",$this->data['Appraisal']['id']), array('escape' => false, 'update' => 'docs_sum', 'complete' => '', 'indicator' => 'loadingx')); ?>

</fieldset>
